<?php
defined('_JEXEC') or die('Restricted access');
//echo "<pre>";print_r($this->data);
?>
<script type="text/javascript" src="<?php echo JURI::base(true)?>/components/com_wrd/assets/js/jquery.capitalize.js"></script>
<script type="text/javascript">
		// <![CDATA[
				jQuery.noConflict();
				jQuery(document).ready(function()
				{
					jQuery("#o_source").change(function () {
						if(jQuery('#o_source option:selected').val() == 'other'){
							jQuery("#fl_o_source").css('display','') ;
						}else{
							jQuery("#fl_o_source").css('display','none') ;
						}
			        });
					jQuery("#f_name").change(function () {
						jQuery("#f_name").val(jQuery.cap(jQuery("#f_name").val())) ;
						jQuery("#l_name").val(jQuery.cap(jQuery("#l_name").val())) ;
						jQuery("#name_on_card").val(jQuery("#l_name").val()+" "+jQuery("#f_name").val()) ;
			        });
					jQuery("#l_name").change(function () {
						jQuery("#f_name").val(jQuery.cap(jQuery("#f_name").val())) ;
						jQuery("#l_name").val(jQuery.cap(jQuery("#l_name").val())) ;
						jQuery("#name_on_card").val(jQuery("#l_name").val()+" "+jQuery("#f_name").val()) ;
			        });
			        
			        jQuery("#p_email").autocomplete("<?php echo JRoute::_("index.php?option=com_wrd&task=checkEmailOverlap&userid=".$this->data->user_id, false)?>", {
					    width: 260,
					    matchContains: true,
					    minChars: 3,
					    selectFirst: false
					});
                });
		// ]]>
	</script>
	
<div class="col width-100">
	<table width="100%">
		<?php if(!empty($this->data->member_id)):?>
		<tr>
			<td class="key">
				<label for="title">Member ID assigned</label>
			</td>
			<td>
				<strong><?php echo $this->data->member_id ; ?></strong>
			</td>
		</tr>
		<?php 
			endif ;
			if(!empty($this->data->l_name) || !empty($this->data->f_name)):
		?>
		<tr>
			<td class="key">
				<label for="title">Member Name</label>
			</td>
			<td>
				<strong><?php echo $this->data->l_name.' '.$this->data->f_name ; ?></strong>
			</td>
		</tr>
		<?php endif ;?>
		<tr>
			<td class="key">
				<label for="title"><?php echo $this->configField['gender']['caption']; ?></label>
			</td>
			<td>
				<?php echo $this->lists['gender']  ; ?>
			</td>
			<td class="key">
				<label for="title"><?php echo $this->configField['prefix']['caption']; ?></label>
			</td>
			<td>
				<?php echo $this->lists['prefix']  ; echo '<b style="color: #FF0000 ;  padding: 0px 5px ;">*</b>' ;  ?>
			</td>
		</tr>
		<tr>
			<td class="key">
				<label for="title"><?php echo $this->configField['f_name']['caption']; ?></label>
			</td>
			<td>
				<input type="text" title="type" maxlength="50" size="50" value="<?php echo ucwords($this->data->f_name); ?>" id="f_name" name="f_name" class="f_name"/>
				<?php echo '<b style="color: #FF0000 ;  padding: 0px 5px ;">*</b>' ; ?> 
			</td>
			<td class="key">
				<label for="title"><?php echo $this->configField['l_name']['caption']; ?></label>
			</td>
			<td>
				<input type="text" title="type" maxlength="50" size="50" value="<?php echo ucwords($this->data->l_name) ; ?>" id="l_name" name="l_name" class="l_name"/>
				<?php echo '<b style="color: #FF0000 ;  padding: 0px 5px ;">*</b>' ; ?> 						
			</td>
		</tr>
		<tr>
			<td class="key">
				<label for="title"><?php echo $this->configField['nationality']['caption']; ?></label>
			</td>
			<td>
				<?php echo $this->lists['nationality']; echo '<b style="color: #FF0000 ;  padding: 0px 5px ;">*</b>' ;  ?>
			</td>
    		<td><label for="title"><?php echo $this->configField['lprefer']['caption']; ?></label></td>
    		<td>
    			<?php echo $this->lists['lang_prefer']; ?>
    		</td>
    	</tr>		
		<tr>
			<td class="key">
				<label for="title"><?php echo $this->configField['dob']['caption']; ?></label>
			</td>
			<td>
				<table>
					<tr>
						<td><?php echo $this->lists['day_birth'] ; ?></td>
						<td valign='top'><?php echo '<b style="color: #FF0000 ;  padding: 0px 5px ;">*</b>' ;  ?></td>
						<td><?php echo $this->lists['month_birth'] ; ?></td>
						<td valign='top'><?php echo '<b style="color: #FF0000 ;  padding: 0px 5px ;">*</b>' ; ?></td>
						<td><?php echo $this->lists['year_birth'] ; ?></td>
						<td valign='top'><?php echo '<b style="color: #FF0000 ;  padding: 0px 5px ;"></b>' ; ?></td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td class="key">
				<label for="title"><?php echo $this->configField['address']['caption']; ?></label>
			</td>
			<td>
				<input type="text" title="type" maxlength="500" size="50" value="<?php echo $this->data->address; ?>" id="address" name="address" class="address" />
				<?php echo '<b style="color: #FF0000 ;  padding: 0px 5px ;">*</b>' ; ?> 
			</td>
			<td class="key">
				<label for="title"><?php echo $this->configField['country']['caption']; ?></label>
			</td>
			<td>
				<?php echo $this->lists['country']; echo '<b style="color: #FF0000 ;  padding: 0px 5px ;">*</b>' ;  ?>
			</td>
		</tr>
		<tr>
			<td class="key">
				<label for="title"><?php echo $this->configField['city']['caption']; ?></label>
			</td>
			<td>
				<?php echo $this->lists['city']; echo '<b style="color: #FF0000 ;  padding: 0px 5px ;">*</b>' ;  ?>
			</td>
			<td class="key">
				<label for="title"><?php echo $this->configField['distric']['caption']; ?></label>
			</td>
			<td>
				<?php echo $this->lists['distric']; echo '<b style="color: #FF0000 ;  padding: 0px 5px ;">*</b>' ;  ?>
			</td>
		</tr>
		<tr>
			<td class="key">
				<label for="title"><?php echo $this->configField['country_code']['caption']; ?></label>
			</td>
			<td>
				<input readonly="readonly" type="text" title="type" maxlength="50" size="50" value="+84" id="country_code" name="country_code" class="country_code"/> 						
			</td>
			<td class="key">
				<label for="title"><?php echo $this->configField['phone']['caption']; ?></label>
			</td>
			<td>
				<input type="text" title="type" maxlength="50" size="50" value="<?php echo $this->data->phone; ?>" id="phone" name="phone" class="phone" />
				<?php echo '<b style="color: #FF0000 ;  padding: 0px 5px ;">*</b>' ; ?> 
			</td>
		</tr>
		<tr>
			<!--
            <td class="key">
              <label for="title"><?php echo $this->configField['o_source']['caption']; ?></label>
			</td>
			
            <td>
                <?php echo $this->lists['o_source']; ?>
            </td>
			-->
            <td>
                <label for="title"><?php echo $this->configField['alternative_email']['caption']; ?></label>
            </td>
            <td colspan="3">
                <input type="text" title="type" maxlength="50" size="50" value="<?php echo $this->data->alternative_email; ?>" id="alternative_email" name="alternative_email" class="phone" /> 
            </td>
        </tr>
        <tr>
			<!--
            <td class="key" align='right'>
                <label for="title">Other</label>
            </td>
            <td>
                <input type="text" title="type" maxlength="50" size="50" value="" id="other_source" name="other_source" class="other_source" />
            </td>
			-->
            <td>
                <label for="title"><?php echo $this->configField['p_email']['caption']; ?></label>
            </td>
            <td colspan="3">
                <input type="text" title="type" maxlength="50" size="50" value="<?php echo $this->data->p_email; ?>" id="p_email" name="p_email" class="p_email"/>     
            </td>
        </tr>
        
		<tr>
			<td class="key">
				<label for="title"><?php echo $this->configField['name_on_card']['caption']; ?></label>
			</td>
			<td>
				<input type="text" title="type" maxlength="50" size="50" value="<?php echo ucwords($this->data->name_on_card) ; ?>" id="name_on_card" name="name_on_card" class="name_on_card"/>
				<?php echo '<b style="color: #FF0000 ;  padding: 0px 5px ;">*</b>' ;  ?> 						
			</td>
    		<!--<td><label for="title"><?php echo $this->configField['pick_up_at']['caption']; ?></label></td>
    		<td>
    			<?php echo $this->lists['pick_up_oulet'];echo '<b style="color: #FF0000 ;  padding: 0px 5px ;">*</b>' ;  ?>
    		</td>-->
            <td class="key">
                <label for="title"><?php echo $this->configField['referer_phone']['caption']; ?></label>
            </td>
            <td>
                <input type="text" value="<?php echo $this->data->referer_phone ;?>" id="referer_phone" name="referer_phone" class="referer_phone" size="40" />
            </td>
    	</tr>
		<tr>
			<td class="key">
					<label for="title"><?php echo $this->configField['referer']['caption']; ?></label>
			</td>
			<td>
				<input type="text" value="<?php echo $this->data->referer ;?>" id="referer" name="referer" class="referer" size="40" />
			</td>
			<td colspan="2">&nbsp;</td>
		</tr>
		<tr>
			<td colspan='2'><?php echo 'The fields <b style="color: #FF0000 ; padding: 0px 5px ;">*</b> are <b style="color: #FF0000 ; padding: 0px 5px ;">required</b>.' ;?></td>
			<td colspan='2'>
				<a href="javascript:void(null)" onclick="javascript:Joomla.submitbutton('apply')">
					<img title="Save & Next" style="float: right ;" src="<?php echo JURI::base() .'/components/com_wrd/assets/images/save_next.png'?>">
				</a>
			</td>
		</tr>
	</table>
</div>